package com.zhouixi.controller;
import com.zhouixi.service.MessageService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/session")
@RestController
public class WebSocketController {

    private final MessageService messageService;

    public WebSocketController(MessageService messageService) {
        this.messageService = messageService;
    }

    @RequestMapping("/send")
    public void sendMessage(Long senderId, Long receiverId, String content) {
        messageService.sendMessage(senderId, receiverId,content);
    }

}
